package command;

import common.ParseException;
import file.FileString;

public class Comment extends Cmd {
    protected Comment(FileString parentFileString) throws ParseException {
        super(parentFileString);
        if (parentFileString.getCommand().length() > 0)
            throw new ParseException(parentFileString, "Строка ошибочно распознана как Comment");
    }

    @Override
    public Cmd getCopy() throws ParseException {
        Comment tCmd = new Comment(getParentFileString().getCopy());
        for (Cmd ttCmd : getBody())
            tCmd.addCmdToBody(ttCmd.getCopy());
        return tCmd;
    }
}
